package com.joven.gateway.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author joven_wong
 * 2021/6/22 14:34
 */
//@Configuration
public class RouteConfiguration {

    @Bean
    public RouteLocator routeLocator(RouteLocatorBuilder builder){

        return builder.routes().route( r->
                r.path("/demo/**")
                        .uri("lb://demo-provider ")
                        .filter(new JovenGatewayFilter())
                        .id("demo_route "))
                .build();
    }
}
